package com.zm.eureka.eurekaclient.controller;

import com.zm.bean.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class EurekaController {
    @RequestMapping("/get")
    public String get(){
        return "Hello Eureka!!!";
    }
    @RequestMapping("/user/{id}")
    public User findById(@PathVariable Long id) {
        return new User("zm", id);
    }

    @RequestMapping("/save")
    public String findById(User user) {
        return "User对象已保存："+user.toString();
    }
}
